Stamping
Apart from the web interface, edexa.com's blockchain stamping functionality is also possible through an API interaction. In order to get access to our API please create an account.
tip
TESTNET BASEURL
https://api-edexagw.io-world.com/bstamp/v2
Add Stamp
- Please refer to the Webhook Details document for a comprehensive understanding of webhooks. The webhook will deliver the stamped file
status
to you. - The Success-webhook provides the
txId
, which is the unique transaction identifier, for a stamped file, enabling developers to track, audit, and reference the file within the edeXa-ecosystem.
POST hash
- This endpoint will allow you to store metadata to your stamping:
hash
,filename
andmeta-data
. - The request body contains a
JSON
object. - The
hash
anduserId
is required parameters as any unique identity. Other parameters are optional. - Duplicate hash will generate
error
of Already Stamped. - The response will include the
txId
(Unique Transaction Id received from blockchain), ahash
and anid
. - You have to pass your
Bearer Token
via the Authorization parameter through the headers. - Make sure to check Sample Request to understand
metadata
and orher parameters.
Stamp File Hash
cURL
curl --location 'https://api-edexagw.io-world.com/bstamp/v2/hash' \
--data '{
"hash": "6d6db6c24********************",
"userId": "cb611d17**************",
"metadata": "hello world",
"metadata1": 10,
"metadata2": {
"key": "value"
},
"metadata3": [
"value",
"value1"
],
"metadata4": [
{
"key": "value"
},
{
"key1": "value1"
}
]
}'
Parameters
Key | Value | Type | Description |
---|---|---|---|
hash* | file | file | The file which oyu want stamp. |
userId* | 16308d***************** | String | The id of user |
metadata | Hello world | String | Any metadata you want to add |
- Accepted metadata formats are :
String
orNumber
orObject
orArray of String
orArray of Objects
Sample Request: To Understand what type of metadata user can pass in request
{
"hash": "6d6db6c24a4as1a************",
"userId": "cb611d1********",
"metadata": "hello world",
"metadata1": 10,
"metadata2": {
"key": "value"
},
"metadata3": ["value", "value1"],
"metadata4": [
{
"key": "value"
},
{
"key1": "value1"
}
]
}
Responses
201: Success
{
"status": 201,
"message": "Your hash is created with block chain",
"data": {
"id": "63f8ae88*************",
"hash": "6d6db6c24a4as1a8************",
"txid": "0x1bacbb2**************",
"code": "7f5***",
"filename": "09-05-2023_12:31:30.json"
}
}
401: Unauthorized
{
"status": 401,
"message": "Invalid auth token"
}
500:Internal Server Error
{
"status": 500,
"message": "Something went wrong, please try again"
}
Get Details of Stamp File
GET hash?id=code
- The GET Stamp API call will check whether a hash has been posted on the selected blockchain. This endpoint can also be used to fetch the transaction id, hash details, or other metadata associated with the stamp that you have created.
- To get the Stamped Value, you can pass
hash
ortxId
orcode
as query parameter and required parameters are marked with*
. - You can get stamped file
hash
ortxId
orcode
from Add Stamp method. - The
txId
is Unique Transaction ID received from blockchain - The
code
is Unique shord code generated correspond to hash for each stamped file and hash - You have to pass your
Bearer Token
via the Authorization parameter through the headers.
Stamp File
cURL
curl --location -g --request GET ' https://api-edexagw.io-world.com/bstamp/v2/hash?id=d9f239' \
--header 'Authorization: Bearer token'
Parameters
Key | Value | Type | Description |
---|---|---|---|
id* | d9f239 | String | code or hash or txid |
Responses
200: Success
{
"status": 200,
"message": "Get details successfully",
"data": {
"hash": "80ca5c*****************",
"originalDocHash": "80ca5c**********************",
"metaData": [
{
"metadata": "hello world",
"metadata1": 10,
"metadata2": {
"key": "value"
},
"metadata3": ["value", "value1"],
"metadata4": [
{
"key": "value"
},
{
"key1": "value1"
}
],
"path": "/hash"
}
],
"filename": "09-05-2023_12:15:35.json",
"type": "0",
"txid": "853172***********************************************",
"timestamp": "2023-05-09T04:56:38.020Z",
"code": "d9f239",
"username": "J*** D**",
"userVerify": 1,
"isEsign": false,
"isPrivateBc": true
}
}
401: Unauthorized
{
"status": 401,
"message": "Invalid auth token"
}
500:Internal Server Error
{
"status": 500,
"message": "Something went wrong, please try again"
}
Get List of All Stamps
GET hash?page=1&limit=10
- The GET Stamp API call will check whether a hash has been posted on the selected blockchain. This endpoint can also be used to fetch the array of objects which have transaction id, hash details, or other metadata associated with the stamp that you have created on edeXa bStamp.
- To get the Stamped Value, you can pass
userId
orstatus
orpage
&limit
as query parameter and required parameters are marked with*
. - You have to pass your
Bearer Token
via the Authorization parameter through the headers.
Stamp File
cURL
curl --location -g --request GET ' https://api-edexagw.io-world.com/bstamp/v2/hash?page=1&limit=10' \
--header 'Authorization: Bearer token'
Parameters
Key | Value | Type | Description |
---|---|---|---|
userId* | cb611d17*************** | String | The id of user |
status | false | Boolean | The value shuold be either true/false |
page | 1 | Number | |
limit | 10 | Number | To set number of data at requested page |
search | d9f239 | String | Search is possible on the basis of code or name |
Responses
200: Success
{
"status": 200,
"message": "Get details successfully",
"data": {
"count": 1,
"files": [
{
"_id": "63f8a****",
"userId": "63f8ad************",
"clientId": "cb611d17************************",
"name": "abc.pdf",
"txId": "0x1bacbb29ce565d**********",
"code": "7f51ea",
"isEsign": false,
"createdAt": "2023-02-24T12:31:30.070Z"
}
]
}
}
401: Unauthorized
{
"status": 401,
"message": "Invalid auth token"
}
500:Internal Server Error
{
"status": 500,
"message": "Something went wrong, please try again"
}